1. Technical Field
The present invention relates to a robot-position detecting device that detects the position of a robot and a robot system including the robot-position detecting device.
2. Related Art
There are known methods for correcting a target position of a robot that grips a workpiece. For example, in Japanese Patent No. 4539685, an image pickup apparatus, which picks up an image of a workpiece, and a robot are respectively moved to predetermined positions such that the workpiece gripped by a robot and a reference mark provided in the robot are arranged in an image pickup area of the image pickup apparatus. The image picked up by the image pickup apparatus is subjected to image processing, whereby a center coordinate, a tilt, and the like of the workpiece with respect to the reference mark are acquired. A position correction amount concerning a target position of the robot is calculated on the basis of the acquired center coordinate and the like.
In the method disclosed in Japanese Patent No. 4539685, it is possible to accurately calculate the position correction amount concerning the target position of the robot. However, the robot needs to be stopped when the image for calculating the position correction amount is picked up. Since the robot is stopped to calculate the position correction amount in a predetermined position, the throughput of the apparatus decreases by an amount equivalent to the time in which the robot is stopped. To suppress such a decrease in the throughput, it is desirable to pick up an image of a moving a workpiece without stopping the robot and to acquire the position correction amount of the robot on the basis of the position of the robot at the time of the image pickup and the picked-up image of the workpiece.
On the other hand, data from an encoder indicating the position of the robot is usually input to a robot controller through serial communication. Therefore, the data is input to the robot controller at a time that is later than a time of the output of the data by a communication time between the encoder and the robot controller corresponding to a communication period, a data amount, and the like of the serial communication. When the data is input, if the robot is constantly moving as explained above, a position calculated based on the encoder and a position obtained from the image are different from each other on a time axis.